determine the nth term of an arithmetic sequence